<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title> kValidator.js</title>
<script src="../kscriptor.1.1.2.js" type="text/javascript"></script>
<script type="text/javascript">

// use my kValidator method
_ks.ready( function(){	
	_ks.elem("#submitBtn").bind("click", function(){
		_ks.validate({
			form: "sample_form",
			fields: [
				{ name: "email", rules: "email,required"},
				{ name: "password", rules : "required,alpha" },
				{ name: "fullname", rules : "required"}				
				],
			success: function( errors ){
				var errors_length = errors.length;
				if( errors_length >0){
					alert( errors.join(","));
				}
			}
		});	
	});	
});

</script>
</head>
<body>
<h1> kScriptor.kValidator.js</h1> 
<span id="errors"> </span>
<form name="sample_form" method="POST" action="sample.php">
	Email: <input name="email" id="email"> <br/>
	Fullnames: <input name="fullname" id="fullname"> <br/>
	Password: <input name="password" id="password">
	<button class="button gray" type="submit" id="submitBtn" name="submit">Submit</button>
</form>
</body></html>